package com.sgcc.pda.hzaidl.impl;

import android.os.RemoteException;

import com.sgcc.pda.hw.IBluetoothConnStatusCallback;
import com.sgcc.pda.hw.IWsReceiveDataCallback;
import com.sgcc.pda.hw.ReturnResult;
import com.sgcc.pda.hzaidl.entity.HardWareCallback;
import com.sgcc.platforminterface.PlatfInterfManager;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @创建者：suven on 2019/12/17 14:26
 * @描述：
 * @版本：1.0
 * @修改人：
 * @修改时间：
 * @修改说明：
 * @修改版本：
 */
public class ProtocolWSManager {
    private static ProtocolWSManager mInstance;

    /**
     * 单例
     *
     * @return
     */
    public static synchronized ProtocolWSManager getInstance() {
        if (mInstance == null) {
            mInstance = new ProtocolWSManager();
        }

        return mInstance;
    }

    /**
     * 蓝牙初始化
     *
     * @return ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:   size==0
     * <p>
     * <p>
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void bluetoothInit(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            // 若是背夹模式需要先断开背夹蓝牙连接,
            if (BackClipManager.getInstance().btIsConnect()) {
                BackClipManager.getInstance().btDisConnect();
            }
            HardWareUtil.requestHardwareData("ws_bluetoothInit", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().bluetoothInit(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 释放蓝牙占用的资源
     *
     * @return ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:   size==0
     * <p>
     * <p>
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void bluetoothRelease(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_bluetoothRelease", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().bluetoothRelease(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 读取外设设备信息
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * <p>
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void queryWSDeviceInfo(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_queryWSDeviceInfo", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().queryWSDeviceInfo(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 获取计量外设的温度
     * <p>
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后温度的结果（2℃）
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCalWsTypeWd(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCalWsTypeWd", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeWd(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 获取计量外设的湿度
     * <p>
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后湿度的结果
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCalWsTypeSd(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCalWsTypeSd", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeSd(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 场强检测
     * <p>
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后场强的结果
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCalWsTypeCQCheck(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCalWsTypeCQCheck", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeCQCheck(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 获取电能表误差数据
     *
     * @param testMeterAddress 被测表地址
     * @param pulseNum         脉冲次数
     *                         <p>
     *                         通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         :List<String> datas（code==0）:
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后电能表误差数据的结果
     *                         :List<String> datas(code==其他):（size==0）
     *                         错误描述
     */
    public void getCalWsTypeMeterErrorData(String testMeterAddress, String pulseNum, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("testMeterAddress", testMeterAddress);
                jb.put("pulseNum", pulseNum);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeMeterErrorData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeMeterErrorData(testMeterAddress, pulseNum, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 获取电能表谐波数据
     *
     * @param testMeterAddress 被测表地址
     * @param xbsjlx           谐波数据类型
     *                         <p>
     *                         通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         :List<String> datas（code==0）:
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后电能表谐波数据的结果
     *                         :List<String> datas(code==其他):（size==0）
     *                         错误描述
     */
    public void getCalWsTypeMeterXBSJData(String testMeterAddress, String xbsjlx, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("testMeterAddress", testMeterAddress);
                jb.put("xbsjlx", xbsjlx);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeMeterXBSJData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeMeterXBSJData(testMeterAddress, xbsjlx, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取电能表接线错误数据
     *
     * @param testMeterAddress 被测表地址
     * @param fzlx             负载类型
     * @param glys1            功率因数1
     * @param glys2            功率因数2
     *                         通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         :List<String> datas（code==0）:
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后电能表接线错误数据的结果
     *                         :List<String> datas(code==其他):（size==0）
     *                         错误描述
     */
    public void getCalWsTypeMeterJXCWData(String testMeterAddress, String fzlx, String glys1, String glys2, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("testMeterAddress", testMeterAddress);
                jb.put("fzlx", fzlx);
                jb.put("glys1", glys1);
                jb.put("glys2", glys2);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeMeterJXCWData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeMeterJXCWData(testMeterAddress, fzlx, glys1, glys2, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 串户检测
     *
     * @param userNo 用户表号
     *               <p>
     *               通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *               :List<String> datas（code==0）:
     *               0:外设返回帧的16进制字符串
     *               1:返回解析后串户检测的结果
     *               :List<String> datas(code==其他):（size==0）
     *               错误描述
     */
    public void getCalWsTypeDoCHJC(String userNo, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", userNo);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeDoCHJC", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeDoCHJC(userNo, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 进行台区识别
     *
     * @param param_mode 台区检测模式（启动、关闭等）
     *                   <p>
     *                   通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                   :List<String> datas（code==0）:
     *                   0:外设返回帧的16进制字符串
     *                   1:返回解析后执行台区识别的结果
     *                   :List<String> datas(code==其他):（size==0）
     *                   错误描述
     */
    public void getCalWsTypeDoTQSB(String param_mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", param_mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeDoTQSB", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeDoTQSB(param_mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取台区识别结果
     *
     * @param param_mode 台区分支模式（00：台区识别模式，01：分支识别模式）
     *                   通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                   :List<String> datas（code==0）:
     *                   0:外设返回帧的16进制字符串
     *                   1:返回解析后获取台区识别的结果
     *                   :List<String> datas(code==其他):（size==0）
     *                   错误描述
     */
    public void getCalWsTypeDoTQSBDo(String param_mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", param_mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeDoTQSBDo", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeDoTQSBDo(param_mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 电能表故障检测
     *
     * @param meterAddress 被测表地址
     *                     通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                     :List<String> datas（code==0）:
     *                     0:外设返回帧的16进制字符串
     *                     1:返回解析后电能表故障的结果
     *                     :List<String> datas(code==其他):（size==0）
     *                     错误描述
     */
    public void getCalWsTypeMeterFault(String meterAddress, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("meterAddress", meterAddress);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCalWsTypeMeterFault", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCalWsTypeMeterFault(meterAddress, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取sim卡信息
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后sim卡相关信息
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCjWsTypeGetSimInfo(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCjWsTypeGetSimInfo", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeGetSimInfo(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 下发sim卡参数
     *
     * @param tmnl_address      终端通讯地址（4字节）
     * @param protocol_type     协议类型（1字节）（00：09规约  01：13规约）
     * @param web_ip            主站ip地址（4字节）
     * @param web_port          主站端口号（2字节）
     * @param operators_type    运营商类型（1字节）(00：自动 01：移动 02：联通 03：电信)
     * @param wlzs_type         网络制式（1字节）（00：自动01：2G网络02：3G网络 03：4G网络）
     * @param apn_name          apn名称（16字节）
     * @param network_name      专网用户名（16字节）
     * @param network_pwd       专网用户密码（16字节）
     * @param transmission_mode 传输方式（1字节）(01:TCP 02:UDP)
     *                          <p>
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后下发sim参数的结果（2℃）
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeSendSimDetentParam(String tmnl_address, String protocol_type, String web_ip,
                                              String web_port, String operators_type, String wlzs_type,
                                              String apn_name, String network_name, String network_pwd,
                                              String transmission_mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("tmnl_address", tmnl_address);
                jb.put("protocol_type", protocol_type);
                jb.put("web_ip", web_ip);
                jb.put("web_port", web_port);
                jb.put("operators_type", operators_type);
                jb.put("wlzs_type", wlzs_type);
                jb.put("apn_name", apn_name);
                jb.put("network_name", network_name);
                jb.put("network_pwd", network_pwd);
                jb.put("transmission_mode", transmission_mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeSendSimDetentParam", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeSendSimDetentParam(tmnl_address, protocol_type, web_ip,
                    web_port, operators_type, wlzs_type,
                    apn_name, network_name, network_pwd,
                    transmission_mode, new IWsReceiveDataCallback.Stub() {
                        @Override
                        public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                            if (hardWareCallback != null)
                                hardWareCallback.onReceiverData(returnResult);
                        }
                    });
    }


    /**
     * 获取sim卡检测结果
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后sim卡检测的结果
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCjWsTypeGetSimDetentResult(final HardWareCallback hardWareCallback) throws RemoteException {

        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCjWsTypeGetSimDetentResult", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeGetSimDetentResult(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });

    }


    /**
     * 停止任务执行（采集和计量）
     * <p>
     * 通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     * :List<String> datas（code==0）:
     * 0:外设返回帧的16进制字符串
     * 1:返回解析后执行退出任务的结果
     * :List<String> datas(code==其他):（size==0）
     * 错误描述
     */
    public void getCjAndCalWsTypeQuitTask(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCjAndCalWsTypeQuitTask", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjAndCalWsTypeQuitTask(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 采集器整机检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     * @param date              日期（4字节，格式YYMMDDWW）
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行退出任务的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeCjqZJCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, String date, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
                jb.put("date", date);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeCjqZJCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeCjqZJCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, date, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 集中器整机检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     * @param date              日期（4字节，格式YYMMDDWW）
     *                          broadCastAction   自定义action用于其他app区分当前操作项
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行集中器整机检测的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeJzqZJCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, String date, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
                jb.put("date", date);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeJzqZJCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeJzqZJCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, date, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 电能表整机检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     *                          <p>
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行电能表整机检测的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeMeterZJCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeMeterZJCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeMeterZJCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 电能表载波模块检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     * @param date              日期（4字节，格式YYMMDDWW）
     *                          自定义action用于其他app区分当前操作项
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行电能表载波模块检测的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeMeterModuleCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, String date, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
                jb.put("date", date);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeMeterModuleCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeMeterModuleCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, date, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 集中器载波模块检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     * @param date              日期（4字节，格式YYMMDDWW）
     *                          自定义action用于其他app区分当前操作项
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行集中器载波模块检测的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeJzqModuleCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, String date, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
                jb.put("date", date);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeJzqModuleCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeMeterModuleCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, date, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 采集器载波模块检测
     *
     * @param masterNodeAddress 主节点地址 (6字节)
     * @param fromNodeAddress   从节点地址（6字节）
     * @param moduleType        模块类型（1字节）(00：09模块  01：13模块)
     * @param meter_type        表计类型（1字节）(00：97协议 01：07协议 02:13协议)
     * @param date              日期（4字节，格式YYMMDDWW）
     *                          自定义action用于其他app区分当前操作项
     *                          通过广播接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                          :List<String> datas（code==0）:
     *                          0:外设返回帧的16进制字符串
     *                          1:返回解析后执行采集器载波模块检测的结果
     *                          :List<String> datas(code==其他):（size==0）
     *                          错误描述
     */
    public void getCjWsTypeCjqModuleCheck(String masterNodeAddress, String fromNodeAddress, String moduleType, String meter_type, String date, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("masterNodeAddress", masterNodeAddress);
                jb.put("fromNodeAddress", fromNodeAddress);
                jb.put("moduleType", moduleType);
                jb.put("meter_type", meter_type);
                jb.put("date", date);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getCjWsTypeCjqModuleCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeCjqModuleCheck(masterNodeAddress, fromNodeAddress, moduleType, meter_type, date, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 设备自检功能
     */
    public void getCjWsTypeDeviceCheck(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getCjWsTypeDeviceCheck", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getCjWsTypeDeviceCheck(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 查询设备状态
     */
    public void getWsDeviceStatus(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getWsDeviceStatus", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsDeviceStatus(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 查询EPC盘存
     *
     * @param bqqy_sp     标签区域
     * @param xzbz_sp     选择标志
     * @param pcms_sp     盘存模式
     * @param pczq_et     盘存周期
     * @param tidlenth_et 读取长度
     *                    用于接收服务返回值的回调
     *                    通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                    List<String> datas（code==0）:（size==2）
     *                    0:外设返回帧的16进制字符串
     *                    1:返回解析后执行采集器载波模块检测的结果
     *                    List<String> datas(code==其他):（size==1）
     *                    错误描述
     */
    public void getWsEPCPC(String bqqy_sp, String xzbz_sp, String pcms_sp, String pczq_et, String tidlenth_et, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("bqqy_sp", bqqy_sp);
                jb.put("xzbz_sp", xzbz_sp);
                jb.put("pcms_sp", pcms_sp);
                jb.put("pczq_et", pczq_et);
                jb.put("tidlenth_et", tidlenth_et);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsEPCPC", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsEPCPC(bqqy_sp, xzbz_sp, pcms_sp, pczq_et, tidlenth_et, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 查询GB盘存
     *
     * @param bqqy_sp     标签区域
     * @param xzbz_sp     选择标志
     * @param pcms_sp     盘存模式
     * @param pczq_et     盘存周期
     * @param tidlenth_et 读取长度
     *                    用于接收服务返回值的回调
     *                    通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                    List<String> datas（code==0）:（size==2）
     *                    0:外设返回帧的16进制字符串
     *                    1:返回解析后执行采集器载波模块检测的结果
     *                    List<String> datas(code==其他):（size==1）
     *                    错误描述
     */
    public void getWsGBPC(String bqqy_sp, String xzbz_sp, String pcms_sp, String pczq_et, String tidlenth_et, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("bqqy_sp", bqqy_sp);
                jb.put("xzbz_sp", xzbz_sp);
                jb.put("pcms_sp", pcms_sp);
                jb.put("pczq_et", pczq_et);
                jb.put("tidlenth_et", tidlenth_et);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsGBPC", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsGBPC(bqqy_sp, xzbz_sp, pcms_sp, pczq_et, tidlenth_et, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * EPC选择标签信息
     *
     * @param lxSp             类型
     * @param pxwz             偏移位置
     * @param ppsjEt           匹配数据
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWsxzdata(String lxSp, String pxwz, String ppsjEt, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("lxSp", lxSp);
                jb.put("pxwz", pxwz);
                jb.put("ppsjEt", ppsjEt);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsxzdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsxzdata(lxSp, pxwz, ppsjEt, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * GB选择标签信息
     *
     * @param lxSp             类型
     * @param pxwz             偏移位置
     * @param ppsjEt           匹配数据
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWsGBxzdata(String lxSp, String pxwz, String ppsjEt, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("lxSp", lxSp);
                jb.put("pxwz", pxwz);
                jb.put("ppsjEt", ppsjEt);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsGBxzdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsGBxzdata(lxSp, pxwz, ppsjEt, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * EPC读取标签信息
     *
     * @param aqbsDataSp       安全标识
     * @param EPCsjq           数据区
     * @param EPCpyEt          偏移
     * @param EPCcdEt          偏移长度
     * @param mmEt             密码
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWsdqbcdata(String aqbsDataSp, String EPCsjq, String EPCpyEt, String EPCcdEt, String mmEt, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("aqbsDataSp", aqbsDataSp);
                jb.put("EPCsjq", EPCsjq);
                jb.put("EPCpyEt", EPCpyEt);
                jb.put("EPCcdEt", EPCcdEt);
                jb.put("mmEt", mmEt);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsdqbcdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsdqbcdata(aqbsDataSp, EPCsjq, EPCpyEt, EPCcdEt, mmEt, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * GB读取标签信息
     *
     * @param aqbsDataSp       安全标识
     * @param EPCsjq           数据区
     * @param EPCpyEt          偏移
     * @param EPCcdEt          偏移长度
     * @param mmEt             密码
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWsGBdqbcdata(String aqbsDataSp, String EPCsjq, String EPCpyEt, String EPCcdEt, String mmEt, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("aqbsDataSp", aqbsDataSp);
                jb.put("EPCsjq", EPCsjq);
                jb.put("EPCpyEt", EPCpyEt);
                jb.put("EPCcdEt", EPCcdEt);
                jb.put("mmEt", mmEt);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsGBdqbcdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsGBdqbcdata(aqbsDataSp, EPCsjq, EPCpyEt, EPCcdEt, mmEt, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * EPC写入标签
     *
     * @param Epcaqid          安全标识
     * @param Epcsjq           数据区
     * @param EpcpyEt          偏移
     * @param EpccdEt          长度
     * @param mmEt             密码
     * @param bcData           数据
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWszrbcdata(String Epcaqid, String Epcsjq, String EpcpyEt, String EpccdEt, String mmEt, String bcData, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("Epcaqid", Epcaqid);
                jb.put("Epcsjq", Epcsjq);
                jb.put("EpcpyEt", EpcpyEt);
                jb.put("EpccdEt", EpccdEt);
                jb.put("mmEt", mmEt);
                jb.put("bcData", bcData);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWszrbcdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWszrbcdata(Epcaqid, Epcsjq, EpcpyEt, EpccdEt, mmEt, bcData, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * GB写入标签
     *
     * @param Epcaqid          安全标识
     * @param Epcsjq           数据区
     * @param EpcpyEt          偏移
     * @param EpccdEt          长度
     * @param mmEt             密码
     * @param bcData           数据
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getWsGBzrbcdata(String Epcaqid, String Epcsjq, String EpcpyEt, String EpccdEt, String mmEt, String bcData, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("Epcaqid", Epcaqid);
                jb.put("Epcsjq", Epcsjq);
                jb.put("EpcpyEt", EpcpyEt);
                jb.put("EpccdEt", EpccdEt);
                jb.put("mmEt", mmEt);
                jb.put("bcData", bcData);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getWsGBzrbcdata", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsGBzrbcdata(Epcaqid, Epcsjq, EpcpyEt, EpccdEt, mmEt, bcData, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 清除选择标签
     *
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getemptyChoose(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getemptyChoose", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getemptyChoose(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 终止操作
     *
     * @param hardWareCallback 用于接收服务返回值的回调
     *                         通过回调接收到的数据： ReturnResult  :int code  0 成功  其他失败
     *                         List<String> datas（code==0）:（size==2）
     *                         0:外设返回帧的16进制字符串
     *                         1:返回解析后执行采集器载波模块检测的结果
     *                         List<String> datas(code==其他):（size==1）
     *                         错误描述
     */
    public void getstopOperation(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getstopOperation", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getstopOperation(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 设置计量误差的参数
     */
    public void setJLWSPrames(String wcData, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", wcData);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setJLWSPrames", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setJLWSPrames(wcData, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 读取计量外设误差参数数据
     */
    public void getJLWSPrames(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getJLWSPrames", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getJLWSPrames(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * R485参数设置
     *
     * @param wcData 设置的R485数据
     */
    public void setWsR485(String wcData, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", wcData);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setWsR485", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setWsR485(wcData, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 485参数查询
     *
     * @param hardWareCallback
     */
    public void getWsR485(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getWsR485", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getWsR485(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 下发检查校验仪任务数据
     *
     * @param address  地址
     * @param sendData 帧数据
     * @param mode     1:蓝牙 2:RS485
     */
    public void sendXCJYDeviceParams(String address, String sendData, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("sendData", sendData);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendXCJYDeviceParams", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendXCJYDeviceParams(address, sendData, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取现场校验仪返回的数据
     *
     * @param address  地址
     * @param orderNum 任务唯一标识
     * @param mode     1:蓝牙 2:RS485
     */
    public void getXCJYDeviceData(String address, String orderNum, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("orderNum", orderNum);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getXCJYDeviceData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getXCJYDeviceData(address, orderNum, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 蓝牙直接调用发送方法
     */
    public void sendDataByBlueTooth(String data, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", data);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendDataByBlueTooth", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendDataByBlueTooth(data, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 485直接调用发送方法
     */
    public void sendDataBy485(String data, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", data);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendDataBy485", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendDataBy485(data, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 设置485通讯方式的波特率
     */
    public ReturnResult set485BaudRate(int BaudRate) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", BaudRate);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return HardWareUtil.requestHardwareData("ws_set485BaudRate", jb.toString());
        } else {
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().set485BaudRate(BaudRate);
            ReturnResult returnResult = new ReturnResult();
            returnResult.setCode(0);
            return returnResult;
        }
    }


    /**
     * 设置终端密钥下装的设备类型
     * 当前蓝牙连接的终端类型
     * 默认0=外设协议
     * 1=376.1协议终端
     * 2=698协议终端
     */
    public ReturnResult setMyxzDeviceType(int devicetype) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("data", devicetype);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return HardWareUtil.requestHardwareData("ws_setMyxzDeviceType", jb.toString());
        } else {
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setMyxzDeviceType(devicetype);
            ReturnResult returnResult = new ReturnResult();
            returnResult.setCode(0);
            return returnResult;
        }
    }


    /**
     * 打开485
     */
    public ReturnResult init485() throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            return HardWareUtil.requestHardwareData("ws_init485");
        } else {
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().init485();
            ReturnResult returnResult = new ReturnResult();
            returnResult.setCode(0);
            return returnResult;
        }
    }


    /**
     * 关闭485
     */
    public ReturnResult release485() throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            return HardWareUtil.requestHardwareData("ws_release485");
        } else {
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().release485();
            ReturnResult returnResult = new ReturnResult();
            returnResult.setCode(0);
            return returnResult;
        }
    }


    /**
     * 设置485通讯方式的波特率
     * BaudRate 波特率
     * databits 数据位  5，6，7，8
     * parity 校验位 无，奇，偶校验 = 0，1，2
     * stopbits 停止位    0，1，1.5，2
     */
    public ReturnResult set485Params(int baudRate, int databits, int parity, int stopbits) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("baudRate", baudRate);
                jb.put("databits", databits);
                jb.put("parity", parity);
                jb.put("stopbits", stopbits);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return HardWareUtil.requestHardwareData("ws_set485Params", jb.toString());
        } else {
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().set485Params(baudRate, databits, parity, stopbits);
            ReturnResult returnResult = new ReturnResult();
            returnResult.setCode(0);
            return returnResult;
        }
    }


    /**
     * 设置校验仪时间
     *
     * @param address  地址
     * @param sendData 帧数据
     * @param mode     1:蓝牙 2:RS485
     */
    public void setTimeType(String address, String sendData, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("sendData", sendData);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setTimeType", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setTimeType(address, sendData, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 走字误差下发任务数据
     *
     * @param address  地址
     * @param sendData 帧数据
     * @param mode     1:蓝牙 2:RS485
     */
    public void sendZzwcCheck(String address, String sendData, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("sendData", sendData);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendZzwcCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendZzwcCheck(address, sendData, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取走字误差数据
     *
     * @param address  地址
     * @param orderNum 任务唯一标识
     * @param mode     1:蓝牙 2:RS485
     */
    public void getZzwcCheck(String address, String orderNum, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("orderNum", orderNum);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getZzwcCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getZzwcCheck(address, orderNum, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 接线检查
     *
     * @param address  地址
     * @param orderNum 任务唯一标识
     * @param mode     1:蓝牙 2:RS485
     */
    public void getJxjcCheck(String address, String orderNum, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("orderNum", orderNum);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getJxjcCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getJxjcCheck(address, orderNum, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 日计时误差参数任务下发
     *
     * @param address  地址
     * @param sendData 帧数据
     * @param mode     1:蓝牙 2:RS485
     */
    public void sendRjsCheck(String address, String sendData, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("sendData", sendData);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendRjsCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendRjsCheck(address, sendData, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 日计时误差参数获取任务结果数据
     *
     * @param address  地址
     * @param orderNum 任务唯一标识
     * @param mode     1:蓝牙 2:RS485
     */
    public void getRjsCheck(String address, String orderNum, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("orderNum", orderNum);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getRjsCheck", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getRjsCheck(address, orderNum, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) throws RemoteException {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 硬件复位命令
     *
     * @param address 地址
     * @param mode    1:蓝牙 2:RS485
     */
    public void setFwData(String address, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setFwData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setFwData(address, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * HPLC信息查询
     *
     * @param address  地址
     * @param startNum 起始序号
     * @param total    节点数量
     * @param mode     1:蓝牙 2:RS485
     */
    public void getHPLCXxcxData(String address, int startNum, int total, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("startNum", startNum);
                jb.put("total", total);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getHPLCXxcxData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getHPLCXxcxData(address, startNum, total, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * HPLC电能表信息查询
     *
     * @param address 地址
     * @param type    协议类型，1，97-645 表 2，07-645 表 3，698
     * @param data    根据协议类型生成的报文
     * @param mode    1:蓝牙 2:RS485
     */
    public void getHPLCDnbXxcxData(String address, int type, int chaoduType, String data, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("type", type);
                jb.put("chaoduType", chaoduType);
                jb.put("data", data);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_getHPLCDnbXxcxData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getHPLCDnbXxcxData(address, type, chaoduType, data, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * HPLC通信功能测试
     *
     * @param address 地址
     * @param type    协议类型，1，97-645 表 2，07-645 表 3，698
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCTxgnData(String address, int type, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("type", type);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCTxgnData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCTxgnData(address, type, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * HPLC停电事件主动上报
     *
     * @param address 地址
     * @param type    协议类型，1，97-645 表 2，07-645 表 3，698
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCTdsjzdsbData(String address, int type, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("type", type);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCTdsjzdsbData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCTdsjzdsbData(address, type, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * HPLC组网时间测试
     *
     * @param address 地址
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCZwcsData(String address, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCZwcsData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCZwcsData(address, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 新台区组网效果测试
     *
     * @param address 地址
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCXtqzwxgcsData(String address, String postalAddress, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("postalAddress", postalAddress);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCXtqzwxgcsData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCXtqzwxgcsData(address, postalAddress, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 互换性测试
     *
     * @param address 地址
     * @param type    协议类型，1，97-645 表 2，07-645 表 3，698
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCHhxcsData(String address, int type, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("type", type);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCHhxcsData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCHhxcsData(address, type, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 网络拓扑分析
     *
     * @param address 地址
     * @param mode    1:蓝牙 2:RS485
     */
    public void sendHPLCWltptfxData(String address, int mode, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("address", address);
                jb.put("mode", mode);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCWltptfxData", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCWltptfxData(address, mode, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 通信模块初始化
     *
     * @param mode         1:经典蓝牙 2:ble 3:RS485
     * @param isAutoReConn 是否自动重连
     * @param reConnCount  重连次数
     */
    public void config(int mode, boolean isAutoReConn, int reConnCount) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("mode", mode);
                jb.put("isAutoReConn", isAutoReConn);
                jb.put("reConnCount", reConnCount);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_config", jb.toString());
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().config(mode, isAutoReConn, reConnCount);
    }

    /**
     * 蓝牙连接状态监听
     */
    public void setOnBlueConnStatusListener(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_setOnBlueConnStatusListener", hardWareCallback);
        } else {
            final ReturnResult returnResult = new ReturnResult();
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setOnBlueConnStatusListener(new IBluetoothConnStatusCallback.Stub() {

                @Override
                public void connected() throws RemoteException {
                    returnResult.setCode(0);
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }

                @Override
                public void disConnected() throws RemoteException {
                    returnResult.setCode(-1);
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
        }

    }

    /**
     * 打开蓝牙界面
     */
    public void showBluetoothList() throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {

            HardWareUtil.requestHardwareData("ws_showBluetoothList");
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().showBluetoothList();
    }

    /**
     * 秘钥协商
     *
     * @param esamNum esam 序列号
     * @param jsq     ASCTR单地址应用协商计数器 需要+1
     */
    public void secretkey(String esamNum, String jsq, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("esamNum", esamNum);
                jb.put("jsq", jsq);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_secretkey", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().secretkey(esamNum, jsq, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 清除GB选择标签
     */
    public void getemptyGBChoose(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {

            HardWareUtil.requestHardwareData("ws_getemptyGBChoose", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getemptyGBChoose(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * HPLC通信功能测试   新版方法
     *
     * @param type 协议类型，1，97-645 表 2，07-645 表 3，698
     */
    public void sendHPLCTxgnDataNew(int type, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("type", type);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_sendHPLCTxgnDataNew", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().sendHPLCTxgnDataNew(type, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }


    /**
     * 获取蓝牙连接信息
     */
    public void getBlueDeviceLastConn(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getBlueDeviceLastConn", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().getBlueDeviceLastConn(new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 设置蓝牙读取监听
     */
    public void setAndReleaseBlueReadListener(String flag, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("flag", flag);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setAndReleaseBlueReadListener", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setAndReleaseBlueReadListener(flag, new IWsReceiveDataCallback.Stub() {
                @Override
                public void onWsReceiverData(ReturnResult returnResult) {
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
    }

    /**
     * 连接设备信息，设备信息必须是之前连接过的设备信息通过 getBlueDeviceLastConn获得到的
     */
    public void setBlueConnByDevInfo(int blueType, String devInfo, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("blueType", blueType);
                jb.put("devInfo", devInfo);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setBlueConnByDevInfo", jb.toString(), hardWareCallback);
        } else {
            final ReturnResult returnResult = new ReturnResult();
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance().getProtocolWSManager().setBlueConnByDevInfo(blueType, devInfo, new IBluetoothConnStatusCallback.Stub() {
                @Override
                public void connected() throws RemoteException {
                    returnResult.setCode(0);
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }

                @Override
                public void disConnected() throws RemoteException {
                    returnResult.setCode(-1);
                    if (hardWareCallback != null)
                        hardWareCallback.onReceiverData(returnResult);
                }
            });
        }
    }

    /**
     * 作业安全识别外设识别码
     */
    public void getSafeIdentifyDevice(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_getSafeIdentifyDevice", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance()
                    .getProtocolWSManager()
                    .getSafeIdentifyDevice(
                            new IWsReceiveDataCallback.Stub() {
                                @Override
                                public void onWsReceiverData(ReturnResult returnResult) {
                                    if (hardWareCallback != null)
                                        hardWareCallback.onReceiverData(returnResult);
                                }
                            }
                    );
    }

    /**
     * 作业安全识别任务下发
     *
     * @param appNo    工单编号
     * @param workType 任务类型编码
     * @param time     建立时间
     */
    public void setSafeIdentifysTask(String appNo, String workType, String appType, String time, final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            JSONObject jb = new JSONObject();
            try {
                jb.put("appNo", appNo);
                jb.put("workType", workType);
                jb.put("time", time);
                jb.put("appType", appType);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            HardWareUtil.requestHardwareData("ws_setSafeIdentifysTask", jb.toString(), hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance()
                    .getProtocolWSManager()
                    .setSafeIdentifysTask(
                            appNo,
                            workType,
                            appType,
                            time,
                            new IWsReceiveDataCallback.Stub() {
                                @Override
                                public void onWsReceiverData(ReturnResult returnResult) {
                                    if (hardWareCallback != null)
                                        hardWareCallback.onReceiverData(returnResult);
                                }
                            }
                    );
    }

    /**
     * 作业安全识别从站异常推送
     */
    public void setSafeIdentifySend(final HardWareCallback hardWareCallback) throws RemoteException {
        if (PlatfInterfManager.getInstance().isSpeed()) {
            HardWareUtil.requestHardwareData("ws_setSafeIdentifySend", hardWareCallback);
        } else
            com.sgcc.pda.hw.impl.ProtocolWSManager.getInstance()
                    .getProtocolWSManager()
                    .setSafeIdentifySend(
                            new IWsReceiveDataCallback.Stub() {
                                @Override
                                public void onWsReceiverData(ReturnResult returnResult) {
                                    if (hardWareCallback != null)
                                        hardWareCallback.onReceiverData(returnResult);
                                }
                            }
                    );
    }

}
